//
//  Stream.swift
//  MyVideo
//
//  Created by han on 2021/4/22.
//

import UIKit

class Stream: Codable {
    let name: String
    let playlistURL: String
    
    // 使用CodingKeys更改structs的properties
    enum CodingKeys: String, CodingKey {
        case name = "name"
        case playlistURL = "playlist_url"
    }
    // 即使不打算重新命名所有的键也要在CodingKeys中列出所有的键, 可以只写个name
}

extension Stream: Equatable {
    static func == (lhs: Stream, rhs: Stream) -> Bool {
        lhs.name == rhs.name && lhs.playlistURL == rhs.playlistURL
    }
}
